<template>

  <div class="nav">
    <van-tabs v-model:active="active">
      <van-tab title="全部"/>
      <van-tab title="待付款"/>
      <van-tab title="配送中"/>
      <van-tab title="退款"/>
    </van-tabs>
  </div>


  <div class="wrapper">
    <ul>
      <li @click="handleBookDetail">
        <div class="title">
          <span>2011-11-11 11:11:11</span>
          <span class="status">待支付</span>
        </div>
        <div class="content">
          <div class="left">
            <div class="food">
              <img src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg">
              <p>最好吃吃吃吃吃吃吃吃吃吃吃</p>
            </div>
            <div class="food">
              <img src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg">
              <p>最好吃吃吃吃吃吃吃吃吃吃吃</p>
            </div>
          </div>

          <div class="right">
            <p class="amount">¥300</p>
            <p class="total">共<span>2</span>件</p>
          </div>
        </div>
        <div class="footer">
          <van-button color="#FFC200" size="small">去&nbsp;支&nbsp;付</van-button>
        </div>
      </li>

      <li>
        <div class="title">
          <span>2011-11-11 11:11:11</span>
          <span class="status">待支付</span>
        </div>
        <div class="content">
          <div class="left">
            <div class="food">
              <img src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg">
              <p>最好吃吃吃吃吃吃吃吃吃吃吃</p>
            </div>
            <div class="food">
              <img src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg">
              <p>最好吃吃吃吃吃吃吃吃吃吃吃</p>
            </div>
          </div>

          <div class="right">
            <p class="amount">¥300</p>
            <p class="total">共<span>2</span>件</p>
          </div>
        </div>
        <div class="footer">
          <van-button color="#FFC200" size="small">去&nbsp;支&nbsp;付</van-button>
        </div>
      </li>

      <li>
        <div class="title">
          <span>2011-11-11 11:11:11</span>
          <span class="status">待支付</span>
        </div>
        <div class="content">
          <div class="left">
            <div class="food">
              <img src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg">
              <p>最好吃吃吃吃吃吃吃吃吃吃吃</p>
            </div>
            <div class="food">
              <img src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg">
              <p>最好吃吃吃吃吃吃吃吃吃吃吃</p>
            </div>
          </div>

          <div class="right">
            <p class="amount">¥300</p>
            <p class="total">共<span>2</span>件</p>
          </div>
        </div>
        <div class="footer">
          <van-button color="#FFC200" size="small">去&nbsp;支&nbsp;付</van-button>
        </div>
      </li>
    </ul>

  </div>

</template>

<script setup lang="ts">
import {ref, reactive} from 'vue';
import {useRouter} from 'vue-router';

const router =useRouter();

let active = ref(0);

let handleBookDetail=()=>{
  router.push({"path":"/book/110"});
}

</script>

<style scoped>

.nav{
  height: 44px;
  background-color: rebeccapurple;
  position: fixed;
  top: 0px;
  width: 100%;
}

  .wrapper{
    margin-top: 44px;
    padding: 10px 10px 0 10px;
  }

  .wrapper ul{
    background-color:#F6F6F6;
  }

  .wrapper ul li{
    background-color:#ffffff;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
  }

  .wrapper ul li:first-child{
    margin-top: 0;
  }

  .wrapper ul li .title{
    display: flex;
    justify-content: space-between;

    align-items: baseline;
    line-height: 14px;
    font-size: 14px;
  }

  .wrapper ul li .title .status{
    color:#F69533;
    font-size: 16px;
  }

  .wrapper ul li .content{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    color: #707070;
  }

  .wrapper ul li .content .left{
    display: flex;
    align-content: center;
  }

  .wrapper ul li .content .food{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-right: 8px;
    font-size: 14px;
    width: 80px;
  }

  .wrapper ul li .content .food img{
    width: 80px;
    height: 80px;
  }

  .wrapper ul li .content .food p{
    width: 100%;
    padding: 2px 0;
    white-space: nowrap; /* 禁止文本换行 */
    overflow: hidden; /* 隐藏超出容器的文本 */
    text-overflow: ellipsis; /* 使用省略号代替隐藏的内容 */
  }

  .wrapper ul li .content .right{
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .wrapper ul li .content .right .amount{
    font-weight: bold;
  }

  .wrapper ul li .content .right .total{
    font-size: 12px;
  }

  .wrapper ul li .content .right .total span{
    margin: 0 2px;
  }

  .wrapper ul li .footer{
    margin: 0 2px;
    display: flex;
    justify-content: right;
  }
</style>
